package dev.devlok.springcloudstreamzeromqbinder.config;

import dev.devlok.springcloudstreamzeromqbinder.ZeroMqMessageBinder;
import dev.devlok.springcloudstreamzeromqbinder.provisioners.ZeroMqMessageBinderProvisioner;

import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class ZeroMqMessageBinderConfiguration {

    @Bean
    @ConditionalOnMissingBean
    public ZeroMqMessageBinderProvisioner zeroMqMessageBinderProvisioner() {
        return new ZeroMqMessageBinderProvisioner();
    }

    @Bean
    @ConditionalOnMissingBean
    public ZeroMqMessageBinder zeroMqMessageBinder(ZeroMqMessageBinderProvisioner zeroMqMessageBinderProvisioner) {
        return new ZeroMqMessageBinder(null, zeroMqMessageBinderProvisioner);
    }

}
